import { Card, Button, Modal } from 'flowbite-react'
import { FaBook, FaPlus } from 'react-icons/fa'
import CardEditor from '../CardEditor'
export default function CardEditorModal({
  show,
  onClose,
  selectedDeck,
  onCancel,
  editingCard,
  onSave
}) {
  return (
    <Modal
    show={show}
    onClose={() => onClose(false)}
    size="4xl"
    className="max-w-4xl"
    dismissible
    position="center"
>
    <Modal.Header className="border-b">
        <div className="flex items-center gap-2">
            <FaPlus className="text-blue-500" />
            <h3 className="text-xl font-semibold">
                向 {selectedDeck?.name} 添加卡片
            </h3>
        </div>
    </Modal.Header>
    <Modal.Body className="p-6">
        <CardEditor
            deckId={selectedDeck?.id || ''}
            onSave={onSave}
            onCancel={onCancel}
            initialData={editingCard}
        />
    </Modal.Body>
</Modal>
  )
}